package org.sjlt.marc.resources;

import java.io.Serializable;
import java.sql.Date;
import java.text.SimpleDateFormat;

import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

public class Meeting implements Serializable, JSONAware 
{
	private static final long serialVersionUID = -5942074911000684858L;
	private Integer mtgID;
	private String mtgType;
	private Date startDate;
	private Date endDate;
	private String startedBy;
	private String endedBy;
	private Integer attendees;
	
	public Meeting(Integer mtgID, String mtgType, Date startDate, Date endDate, String startedBy, 
			String endedBy, Integer attendees)
	{
		this.mtgID = mtgID;
		this.startDate = startDate;
		this.endDate = endDate;
		this.mtgType = mtgType;
		this.startedBy = startedBy;
		this.endedBy = endedBy;
		this.attendees = attendees;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() 
	{
		JSONObject obj = new JSONObject();
		SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
		
		obj.put("MeetingID", this.mtgID);
		obj.put("Meeting Type", this.mtgType);
		obj.put("Start Date", sdf.format(this.startDate));
		obj.put("End Date", sdf.format(this.endDate));
		obj.put("Started By", this.startedBy);
		obj.put("Ended By", this.endedBy);
		obj.put("Attendees", this.attendees);
		
		return obj.toJSONString();
	}

	public Integer getMtgID() {
		return mtgID;
	}

	public void setMtgID(Integer mtgID) {
		this.mtgID = mtgID;
	}

	public String getMtgType() {
		return mtgType;
	}

	public void setMtgType(String mtgType) {
		this.mtgType = mtgType;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getStartedBy() {
		return startedBy;
	}

	public void setStartedBy(String startedBy) {
		this.startedBy = startedBy;
	}

	public String getEndedBy() {
		return endedBy;
	}

	public void setEndedBy(String endedBy) {
		this.endedBy = endedBy;
	}

	public Integer getAttendees() {
		return attendees;
	}

	public void setAttendees(Integer attendees) {
		this.attendees = attendees;
	}

}
